import { services } from '@/config'

export const tableOption = {
  border: true,
  // index: true,
  // indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 8,
  dialogWidth: '90%',
  dialogTop: '5%',
  // expand: true, // 展开表格
  labelWidth: 120,
  editBtn: false,
  addBtn: false,
  delBtn: false,
  selection: true,
  tip: false,
  viewBtn: false,
  menuWidth: 230,
  column: [
    {
      type: 'select',
      label: '单据类型',
      prop: 'type',
      span: 8,
      search: true,
      display: false,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/type_document`,
      dicMethod: 'get',
      value: 'ALL',
      searchOrder: 99
    },
    {
      type: 'select',
      label: '状态',
      prop: 'status',
      span: 8,
      search: true,
      display: false,
      rules: [{ required: true, message: '请选择状态' }],
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchaseapply_status`,
      dicMethod: 'get',
      value: '0',
      searchOrder: 98
    },
    {
      type: 'input',
      label: '唯一编码',
      prop: 'unid',
      span: 8,
      display: false, // 新增查看界面 不显示
      hide: true // 视图界面不显示
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'purchaseOuid',
      span: 8,
      width: 160,
      rules: [{ required: true, message: '请选择采购单位' }],
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get',
      search: true,
      display: false,
      searchOrder: 97
    },
    {
      type: 'input',
      label: '申请单号',
      prop: 'caseid',
      span: 8,
      search: true,
      disabled: false, // 只读
      display: false,
      width: 165,
      searchOrder: 96,
      slot: true
    },
    {
      type: 'datetime',
      label: '申请时间',
      width: 135,
      prop: 'createTime',
      span: 24,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      searchSpan: 12,
      search: true,
      searchRange: true,
      searchOrder: 95
    },
    {
      type: 'input',
      label: '申请人',
      prop: 'createBy',
      span: 24,
      display: false,
      search: true,
      searchOrder: 93
    },
    {
      type: 'tree',
      label: '申请单位',
      prop: 'deptId',
      span: 8,
      dicUrl: `${services.adminService}dept/tree`,
      props: { label: 'name', value: 'id' },
      dicMethod: 'get',
      hide: true,
      search: true,
      required: true,
      searchOrder: 93
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 8,
      display: false,
      hide: true,
      width: 200
    },
    {
      type: 'tree',
      label: '预算编号',
      prop: 'budgetId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetbudget/budgetTree`,
      dicMethod: 'get',
      display: false,
      searchOrder: 92
    },
    {
      type: 'input',
      label: '预算名称',
      prop: 'budgetName',
      span: 8,
      search: true,
      display: false,
      searchOrder: 91
    },
    {
      type: 'tree',
      label: '供应商名称',
      prop: 'supplierId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetsupplier/tree/V`,
      dicMethod: 'get',
      searchLabelWidth: 90,
      display: false,
      width: 120,
      searchOrder: 90
    },
    {
      type: 'input',
      label: '收货信息',
      prop: 'receivinfo',
      span: 8,
      hide: true,
      display: false
    },
    {
      type: 'date',
      label: '到货时间',
      prop: 'arrivalDatetime',
      span: 8,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      width: 135,
      searchSpan: 12,
      searchRange: true,
      searchOrder: 94
    },
    {
      type: 'select',
      label: '采购方式',
      prop: 'method',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get',
      display: false,
      searchOrder: 88
    },
    {
      type: 'number',
      label: '购置价格',
      prop: 'amount',
      span: 8,
      controls: true,
      display: false
    },
    {
      type: 'select',
      label: '货币类型',
      prop: 'currencyType',
      span: 8,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/currency_type`,
      rules: [{ required: true, message: '请选择货币类型' }],
      dicMethod: 'get',
      display: false
    },
    {
      type: 'textarea',
      label: '申请说明',
      span: 24,
      display: false,
      prop: 'explains',
      width: 120,
      hide: false
    },
    {
      type: 'textarea',
      label: '采购明细',
      prop: 'detailedEx',
      span: 24,
      display: false,
      width: 140,
      hide: false
    },
    {
      labelWidth: 0,
      label: '申请明细-物品列表',
      prop: 'info',
      span: 24,
      hide: true,
      formslot: true,
      display: false
    },
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true,
      display: false
    }
  ],
  group: [
    {
      label: '基本信息',
      prop: 'jbxx',
      icon: 'el-icon-edit-outline',
      column: [
        {
          type: 'input',
          label: '单号',
          prop: 'caseid',
          span: 8,
          disabled: true // 只读
        },
        {
          type: 'select',
          label: '单据类型',
          prop: 'type',
          span: 8,
          display: true,
          props: { label: 'label', value: 'value' },
          dicUrl: `${services.adminService}dict/type/type_document`,
          dicMethod: 'get',
          value: 'ALL'
        },
        {
          type: 'select',
          label: '状态',
          prop: 'status',
          span: 8,
          rules: [{ required: true, message: '请选择状态' }],
          props: { label: 'label', value: 'value' },
          dicUrl: `${services.adminService}dict/type/purchaseapply_status`,
          dicMethod: 'get',
          value: '0',
          display: false
        },
        {
          type: 'input',
          label: '唯一编码',
          prop: 'unid',
          span: 8,
          display: false, // 新增查看界面 不显示
          hide: true // 视图界面不显示
        },
        {
          type: 'tree',
          label: '采购单位',
          prop: 'purchaseOuid',
          span: 8,
          rules: [{ required: true, message: '请选择采购单位' }],
          props: { label: 'name', value: 'id' },
          dicUrl: `${services.adminService}dept/tree`,
          dicMethod: 'get'
        },
        {
          type: 'input',
          label: '批次号',
          prop: 'batchnumber',
          span: 8,
          display: false
        },
        {
          type: 'tree',
          label: '预算编号',
          prop: 'budgetId',
          span: 8,
          props: { label: 'name', value: 'id' },
          dicUrl: `${services.assetService}fyassetbudget/budgetTree`,
          dicMethod: 'get'
        },
        {
          type: 'input',
          label: '预算名称',
          prop: 'budgetName',
          span: 8
        },
        {
          type: 'tree',
          label: '供应商名称',
          prop: 'supplierId',
          span: 8,
          props: { label: 'name', value: 'id' },
          dicUrl: `${services.assetService}fyassetsupplier/tree/V`,
          dicMethod: 'get'
        },
        {
          type: 'input',
          label: '收货信息',
          prop: 'receivinfo',
          span: 8,
          search: true,
          hide: true,
          searchOrder: 87
        },
        {
          type: 'date',
          label: '到货时间',
          prop: 'arrivalDatetime',
          span: 8,
          display: true,
          format: 'yyyy-MM-dd HH:mm:ss',
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
          width: 200
        },
        {
          type: 'select',
          label: '采购方式',
          prop: 'method',
          span: 8,
          props: { label: 'label', value: 'value' },
          dicUrl: `${services.adminService}dict/type/purchase_way`,
          dicMethod: 'get'
        },
        {
          type: 'number',
          label: '采购金额',
          prop: 'amount',
          span: 8,
          controls: true,
          display: true
        },
        {
          type: 'select',
          label: '货币类型',
          prop: 'currencyType',
          span: 8,
          props: { label: 'label', value: 'value' },
          dicUrl: `${services.adminService}dict/type/currency_type`,
          rules: [{ required: true, message: '请选择货币类型' }],
          dicMethod: 'get'
        },
        {
          type: 'textarea',
          label: '采购明细',
          prop: 'detailedEx',
          span: 24,
          display: true,
          hide: true
        },
        {
          type: 'textarea',
          label: '采购说明',
          span: 24,
          display: true,
          prop: 'explains',
          hide: true,
          search: true,
          searchOrder: 86
        },
        {
          type: 'input',
          label: '资产名称',
          span: 24,
          display: true,
          prop: 'cardName',
          hide: true,
          search: true,
          searchOrder: 85
        },
        {
          type: 'input',
          label: '资产编码',
          span: 24,
          display: true,
          prop: 'cardCode',
          hide: true,
          search: true,
          searchOrder: 14
        }
      ]
    },
    {
      label: '申请明细-物品列表',
      prop: 'sqmx',
      icon: 'el-icon-edit-outline',
      column: [
        {
          labelWidth: 0,
          label: '',
          prop: 'info',
          span: 24,
          hide: true,
          formslot: true
        }
      ]
    },
    {
      label: '附件信息',
      prop: 'fjxx',
      icon: 'el-icon-edit-outline',
      column: [
        {
          label: '',
          prop: 'uploadPage',
          type: 'input',
          formslot: true,
          slot: true,
          span: 24,
          hide: true
        }
      ]
    }
  ]
}

export const selectOption = {
  border: true,
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 8,
  viewBtn: false,
  dialogWidth: '90%',
  dialogTop: '5%',
  expand: true, // 展开表格
  rowKey: 'caseid',
  expandRowKeys: [],
  labelWidth: 120,
  addBtn: false,
  editBtn: false,
  menu: false,
  column: [
    {
      label: '选择',
      prop: 'selectBtn',
      slot: true
    },
    {
      type: 'select',
      label: '单据类型',
      prop: 'type',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/type_document`,
      dicMethod: 'get',
      value: 'ALL'
    },
    {
      type: 'select',
      label: '状态',
      prop: 'status',
      span: 8,
      search: true,
      rules: [{ required: true, message: '请选择状态' }],
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchaseapply_status`,
      dicMethod: 'get',
      value: '0',
      hide: true
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'purchaseOuid',
      span: 8,
      rules: [{ required: true, message: '请选择采购单位' }],
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get',
      search: true
    },
    {
      type: 'input',
      label: '单号',
      prop: 'caseid',
      span: 8,
      search: true,
      display: true,
      width: 150
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 8,
      search: true,
      hide: true,
      width: 200
    },
    {
      type: 'tree',
      label: '预算编号',
      prop: 'budgetId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetbudget/budgetTree`,
      dicMethod: 'get',
      hide: true
    },
    {
      type: 'input',
      label: '预算名称',
      prop: 'budgetName',
      span: 8,
      hide: true
    },
    {
      type: 'tree',
      label: '供应商名称',
      prop: 'supplierId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetsupplier/tree/V`,
      dicMethod: 'get',
      searchLabelWidth: 90,
      width: 120
    },
    {
      type: 'input',
      label: '收货信息',
      prop: 'receivinfo',
      span: 8,
      hide: true,
      display: false
    },
    {
      type: 'date',
      label: '到货时间',
      prop: 'arrivalDatetime',
      span: 8,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      width: 200
    },
    {
      type: 'select',
      label: '采购方式',
      prop: 'method',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get',
      display: false
    },
    {
      type: 'number',
      label: '采购金额',
      prop: 'amount',
      span: 8,
      controls: true,
      display: false
    },
    {
      type: 'select',
      label: '货币类型',
      prop: 'currencyType',
      span: 8,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/currency_type`,
      rules: [{ required: true, message: '请选择货币类型' }],
      dicMethod: 'get',
      display: false
    }
  ]
}

//
export const tablePageOption = {
  border: true,
  // index: true,
  // indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 8,
  viewBtn: true,
  dialogWidth: '90%',
  dialogTop: '5%',
  // expand: true, // 展开表格
  labelWidth: 120,
  editBtn: false,
  addBtn: false,
  expand: true,
  rowKey: 'caseid',
  menu: false,
  selection: true,
  searchShow: false,
  column: [
    {
      type: 'select',
      label: '单据类型',
      prop: 'type',
      span: 8,
      search: true,
      display: false,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/type_document`,
      dicMethod: 'get',
      value: 'ALL'
    },
    {
      type: 'select',
      label: '状态',
      prop: 'status',
      span: 8,
      search: true,
      display: false,
      rules: [{ required: true, message: '请选择状态' }],
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchaseapply_status`,
      dicMethod: 'get',
      value: '0'
    },
    {
      type: 'input',
      label: '唯一编码',
      prop: 'unid',
      span: 8,
      display: false, // 新增查看界面 不显示
      hide: true // 视图界面不显示
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'purchaseOuid',
      span: 8,
      rules: [{ required: true, message: '请选择采购单位' }],
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get',
      display: false
    },
    {
      type: 'input',
      label: '单号',
      prop: 'caseid',
      span: 8,
      search: true,
      disabled: false, // 只读
      display: false,
      width: 150
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 8,
      search: true,
      display: false,
      width: 200
    },
    {
      type: 'tree',
      label: '预算编号',
      prop: 'budgetId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetbudget/budgetTree`,
      dicMethod: 'get',
      display: false
    },
    {
      type: 'input',
      label: '预算名称',
      prop: 'budgetName',
      span: 8,
      search: true,
      display: false
    },
    {
      type: 'tree',
      label: '供应商名称',
      prop: 'supplierId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetsupplier/tree/V`,
      dicMethod: 'get',
      display: false,
      searchLabelWidth: 90,
      width: 150
    },
    {
      type: 'input',
      label: '收货信息',
      prop: 'receivinfo',
      span: 8,
      hide: true,
      display: false
    },
    {
      type: 'date',
      label: '到货时间',
      prop: 'arrivalDatetime',
      span: 8,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      width: 200
    },
    {
      type: 'select',
      label: '采购方式',
      prop: 'method',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get',
      display: false
    },
    {
      type: 'number',
      label: '采购金额',
      prop: 'amount',
      span: 8,
      controls: true,
      display: false
    },
    {
      type: 'select',
      label: '货币类型',
      prop: 'currencyType',
      span: 8,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/currency_type`,
      rules: [{ required: true, message: '请选择货币类型' }],
      dicMethod: 'get',
      display: false
    },
    {
      type: 'textarea',
      label: '采购明细',
      prop: 'detailed',
      span: 24,
      display: false,
      hide: true
    },
    {
      type: 'textarea',
      label: '采购说明',
      span: 24,
      display: false,
      prop: 'explains',
      hide: true
    },
    {
      labelWidth: 0,
      label: '申请明细-物品列表',
      prop: 'purchaseapplyList',
      span: 24,
      hide: true,
      formslot: true,
      display: false
    }
  ]
}

export const formOption = {
  labelWidth: 115,
  submitBtn: false,
  emptyBtn: false,
  column: [
    {
      type: 'input',
      label: '申请单号',
      prop: 'caseid',
      span: 8,
      search: true,
      disabled: true, // 只读
      width: 150
    },
    {
      type: 'select',
      label: '单据类型',
      prop: 'type',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/type_document`,
      dicMethod: 'get',
      value: 'ALL',
      rules: [{ required: true, message: '请选择单据类型' }]
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'purchaseOuid',
      span: 8,
      rules: [{ required: true, message: '请选择采购单位' }],
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get'
    },
    {
      type: 'select',
      label: '状态',
      prop: 'status',
      span: 8,
      search: true,
      display: false,
      rules: [{ required: true, message: '请选择状态' }],
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchaseapply_status`,
      dicMethod: 'get',
      value: '0'
    },
    {
      type: 'input',
      label: '唯一编码',
      prop: 'unid',
      span: 8,
      display: false, // 新增查看界面 不显示
      hide: true // 视图界面不显示
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 8,
      search: true,
      display: false,
      width: 200
    },
    {
      type: 'tree',
      label: '预算',
      prop: 'budgetId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetbudget/budgetTree`,
      dicMethod: 'get',
      rules: [{ required: true, message: '请选择预算' }]
    },
    {
      type: 'input',
      label: '预算名称',
      prop: 'budgetName',
      span: 8,
      search: true,
      display: false
    },
    {
      type: 'tree',
      label: '供应商',
      prop: 'supplierId',
      span: 8,
      search: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetsupplier/tree/V`,
      dicMethod: 'get',
      searchLabelWidth: 90,
      width: 150,
      rules: [{ required: true, message: '请选择供应商' }]
    },
    {
      type: 'date',
      label: '期望到货时间',
      prop: 'arrivalDatetime',
      span: 8,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      width: 200
    },
    {
      type: 'select',
      label: '采购方式',
      prop: 'method',
      span: 8,
      search: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get'
    },
    {
      type: 'number',
      label: '采购金额',
      prop: 'amount',
      span: 8,
      controls: true
    },
    {
      type: 'select',
      label: '货币类型',
      prop: 'currencyType',
      span: 8,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/currency_type`,
      rules: [{ required: true, message: '请选择货币类型' }],
      dicMethod: 'get'
    },
    {
      type: 'textarea',
      label: '收货信息',
      prop: 'receivinfo',
      span: 24,
      hide: true
    },
    {
      type: 'textarea',
      label: '采购说明',
      span: 24,
      prop: 'explains',
      hide: true
    },
    {
      type: 'textarea',
      label: '采购明细',
      prop: 'detailed',
      span: 24,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '申请明细-物品列表',
      prop: 'purchaseapplyList',
      span: 24,
      hide: true,
      slot: true,
      formslot: true
    }
  ]
}
